<template>
	<view class="p-page p-price-page">
 
   <view class="" v-if="render('price-dipi') || render('price-sell-office') || render('price-sell-shop')|| render('price-sell-gaocen')">
     	    <view class="title"> 出售总价 </view>
     	    <InputArea placeholder="请输入出售总价" tail="万元" :val="ztPrice.totalPrice" target="ztPrice" wename="totalPrice" />
     </view>
	 <view class="" v-if="render('price-dipi')">
	 			<view class="title"> 地块单价 </view>
	 			<InputArea placeholder="单价以用地面积计算" tail="元/m" :val="ztPrice.unitPrice" target="ztPrice" wename="unitPrice" />
	   </view>
	   
	    <view class="" v-if="render('price-rent-gaocen')">
			<view class="title"> 付租方式 </view>
			<u-radio-group v-model="ztPrice.payRentType" @change="groupChange">
				<view class="flex al">
					<u-radio name="0"> 月付 </u-radio>
					<u-radio name="1"> 季付 </u-radio>
					<u-radio name="2"> 日付 </u-radio>
				</view>
				<view class="flex al">
					<u-radio name="3"> 半年付 </u-radio>
					<u-radio name="4"> 整年付 </u-radio>
				</view>
			</u-radio-group>
			<view class="divider" style="margin: 10px 0 ;"></view>
		</view>	
		
			
	 
		
		<view class="" v-if="!render('price-dipi')">
			<view class="title"> 出租租金 </view>
			<InputArea placeholder="请输入出租金额" tail="元" :val="ztPrice.rent" target="ztPrice" wename="rent" />
			<view class="title"> 付租押金 </view>
			<InputArea placeholder="请输入押金金额" tail="元" :val="ztPrice.deposit" target="ztPrice" wename="deposit" />
			<view class="title"> 物管费 </view>
			<InputArea placeholder="请输入物管费金额" tail="元-m-月" :val="ztPrice.managementFee" target="ztPrice" wename="managementFee" />
			
			 <view class="" v-if="render('price-rent-shop')||render('price-rent-office')">
			 	<view class="title"> 顶手费 </view>
			 	<InputArea placeholder="请输入物管费金额" tail="元-m-月" :val="ztPrice.keyMoney" target="ztPrice" wename="keyMoney" />
			 </view> 
			<view class="divider" style="margin: 10px 0 ;" />
			<view class="title"> 入住时间 </view>
			<view class="flex">
				<view class="time-btn" @click="showDate=true"> {{ ztPrice.settledTime1 }} </view>
				<view class="time-btn"> 随时入住 </view>
			</view>
		</view>
		<u-picker v-model="showDate" mode="time" @confirm="confirm"></u-picker>
	</view>
</template>

<script>
	export default {
		name: "we",
		data() {
			return {
				showDate:false,
				ztPrice: {
				},
			};
		},
	    created() {
	        this.ztPrice.settledTime1 = '2020-11-11'	
	    },
		methods:{
			confirm(data){
				console.log(data);
				this.ztPrice.settledTime1 = `${data.year}-${data.month}-${data.day}`
				var settledTime = `${data.year}-${data.month}-${data.day} 00:00:00`
				this.$store.dispatch('ztPrice', { settledTime });
			},
		}
		
	}
</script>

<style lang="scss">
	.p-price-page {
	   
	   .al{
	     display: flex;
	     align-items: baseline;
	   }
	   .al>view{
	     width: 100px;
	   }
	   .time-btn{
	     border-radius: 4px;
	     border: 1px solid #ccc;
	     display: inline-flex;
	     padding: 0 10px;
	     color: #ccc;
	     font-size: 12px;
		 margin-right: 10px;
	   }
	}
</style>
